
!$OPENAD XXX File_start [OAD_intrinsics.f90]
MODULE oad_intrinsics
use OAD_active
use w2f__types
IMPLICIT NONE
SAVE
!
!     **** Statements ****
!
END MODULE

C$OPENAD XXX File_start [all_globals_mod.f]
      MODULE all_globals_mod
      use OAD_active
      use w2f__types
      IMPLICIT NONE
      SAVE
C
C     **** Statements ****
C
      END MODULE
C#########################################################
C This file is part of OpenAD released under the LGPL.   #
C The full COPYRIGHT notice can be found in the top      #
C level directory of the OpenAD distribution             #
C#########################################################
C
C$OPENAD XXX File_start [head.f]
      SUBROUTINE find_bulkmod(LOCPRES, TFLD, SFLD, BULKMOD)
          use OAD_tape
          use OAD_rev

C original arguments get inserted before version
C         ! and declared here together with all local variables
C         ! generated by xaifBooster

      use OAD_active
      use w2f__types
      use oad_intrinsics
      use oad_intrinsics
      use oad_intrinsics
      IMPLICIT NONE
C
C     **** Global Variables & Derived Type Definitions ****
C
      INTEGER(w2f__i8) OpenAD_Symbol_0
      INTEGER(w2f__i8) OpenAD_Symbol_1
      INTEGER(w2f__i8) OpenAD_Symbol_10
      INTEGER(w2f__i8) OpenAD_Symbol_11
      INTEGER(w2f__i8) OpenAD_Symbol_12
      INTEGER(w2f__i8) OpenAD_Symbol_13
      INTEGER(w2f__i8) OpenAD_Symbol_14
      INTEGER(w2f__i8) OpenAD_Symbol_15
      INTEGER(w2f__i8) OpenAD_Symbol_16
      INTEGER(w2f__i8) OpenAD_Symbol_17
      INTEGER(w2f__i8) OpenAD_Symbol_2
      INTEGER(w2f__i8) OpenAD_Symbol_3
      INTEGER(w2f__i8) OpenAD_Symbol_4
      INTEGER(w2f__i8) OpenAD_Symbol_5
      INTEGER(w2f__i8) OpenAD_Symbol_6
      INTEGER(w2f__i8) OpenAD_Symbol_7
      INTEGER(w2f__i8) OpenAD_Symbol_8
      INTEGER(w2f__i8) OpenAD_Symbol_9
C
C     **** Parameters and Result ****
C
      type(active) :: LOCPRES(1:2,1:2)
      type(active) :: TFLD(1:2,1:2,1:2,1:2,1:2)
      type(active) :: SFLD(1:2,1:2,1:2,1:2,1:2)
      type(active) :: BULKMOD(1:2,1:2)
C
C     **** Local Variables and Functions ****
C
      INTEGER(w2f__i4) BI
      INTEGER(w2f__i4) BJ
      type(active) :: BMFRESH
      type(active) :: BMPRES
      type(active) :: BMSALT
      REAL(w2f__8) EOSJMDCKFW(1 : 5)
      REAL(w2f__8) EOSJMDCKP(1 : 14)
      REAL(w2f__8) EOSJMDCKSW(1 : 7)
      INTEGER(w2f__i4) I
      INTEGER(w2f__i4) J
      INTEGER(w2f__i4) K
      type(active) :: P
      type(active) :: P2
      type(active) :: S
      type(active) :: S3O2
      REAL(w2f__8) SITOBAR
      type(active) :: T
      type(active) :: T2
      type(active) :: T3
      type(active) :: T4
      INTEGER(w2f__i4) OpenAD_Symbol_61
      INTEGER(w2f__i4) OpenAD_Symbol_62
      INTEGER(w2f__i4) OpenAD_Symbol_63
      INTEGER(w2f__i4) OpenAD_Symbol_64
      INTEGER(w2f__i4) OpenAD_Symbol_65
      REAL(w2f__8) OpenAD_Symbol_66
      REAL(w2f__8) OpenAD_Symbol_67
      REAL(w2f__8) OpenAD_Symbol_68
      REAL(w2f__8) OpenAD_Symbol_69
      REAL(w2f__8) OpenAD_Symbol_70
      INTEGER(w2f__i4) OpenAD_Symbol_71
      INTEGER(w2f__i4) OpenAD_Symbol_72
      REAL(w2f__8) OpenAD_Symbol_73
      REAL(w2f__8) OpenAD_Symbol_74
      REAL(w2f__8) OpenAD_Symbol_75
      REAL(w2f__8) OpenAD_Symbol_76
      REAL(w2f__8) OpenAD_Symbol_77
      REAL(w2f__8) OpenAD_Symbol_78
      REAL(w2f__8) OpenAD_Symbol_79
      REAL(w2f__8) OpenAD_Symbol_80
      REAL(w2f__8) OpenAD_Symbol_81
      REAL(w2f__8) OpenAD_Symbol_82
      REAL(w2f__8) OpenAD_Symbol_83
      REAL(w2f__8) OpenAD_Symbol_84
      REAL(w2f__8) OpenAD_Symbol_85
      REAL(w2f__8) OpenAD_Symbol_86
      REAL(w2f__8) OpenAD_Symbol_87
      REAL(w2f__8) OpenAD_Symbol_88
      REAL(w2f__8) OpenAD_Symbol_89
      REAL(w2f__8) OpenAD_Symbol_90
      REAL(w2f__8) OpenAD_Symbol_91
      REAL(w2f__8) OpenAD_Symbol_92
      REAL(w2f__8) OpenAD_Symbol_93
      REAL(w2f__8) OpenAD_Symbol_94
      REAL(w2f__8) OpenAD_Symbol_95
      REAL(w2f__8) OpenAD_Symbol_96
      REAL(w2f__8) OpenAD_acc_0
      REAL(w2f__8) OpenAD_acc_1
      REAL(w2f__8) OpenAD_acc_10
      REAL(w2f__8) OpenAD_acc_11
      REAL(w2f__8) OpenAD_acc_12
      REAL(w2f__8) OpenAD_acc_13
      REAL(w2f__8) OpenAD_acc_14
      REAL(w2f__8) OpenAD_acc_15
      REAL(w2f__8) OpenAD_acc_16
      REAL(w2f__8) OpenAD_acc_17
      REAL(w2f__8) OpenAD_acc_18
      REAL(w2f__8) OpenAD_acc_19
      REAL(w2f__8) OpenAD_acc_2
      REAL(w2f__8) OpenAD_acc_20
      REAL(w2f__8) OpenAD_acc_21
      REAL(w2f__8) OpenAD_acc_22
      REAL(w2f__8) OpenAD_acc_3
      REAL(w2f__8) OpenAD_acc_4
      REAL(w2f__8) OpenAD_acc_5
      REAL(w2f__8) OpenAD_acc_6
      REAL(w2f__8) OpenAD_acc_7
      REAL(w2f__8) OpenAD_acc_8
      REAL(w2f__8) OpenAD_acc_9
      REAL(w2f__8) OpenAD_aux_0
      REAL(w2f__8) OpenAD_aux_1
      REAL(w2f__8) OpenAD_aux_2
      REAL(w2f__8) OpenAD_aux_3
      REAL(w2f__8) OpenAD_aux_4
      REAL(w2f__8) OpenAD_aux_5
      REAL(w2f__8) OpenAD_aux_6
      REAL(w2f__8) OpenAD_aux_7
      REAL(w2f__8) OpenAD_aux_8
      REAL(w2f__8) OpenAD_aux_9
      REAL(w2f__8) OpenAD_lin_0
      REAL(w2f__8) OpenAD_lin_1
      REAL(w2f__8) OpenAD_lin_10
      REAL(w2f__8) OpenAD_lin_11
      REAL(w2f__8) OpenAD_lin_12
      REAL(w2f__8) OpenAD_lin_13
      REAL(w2f__8) OpenAD_lin_14
      REAL(w2f__8) OpenAD_lin_15
      REAL(w2f__8) OpenAD_lin_16
      REAL(w2f__8) OpenAD_lin_17
      REAL(w2f__8) OpenAD_lin_18
      REAL(w2f__8) OpenAD_lin_19
      REAL(w2f__8) OpenAD_lin_2
      REAL(w2f__8) OpenAD_lin_20
      REAL(w2f__8) OpenAD_lin_21
      REAL(w2f__8) OpenAD_lin_22
      REAL(w2f__8) OpenAD_lin_23
      REAL(w2f__8) OpenAD_lin_24
      REAL(w2f__8) OpenAD_lin_25
      REAL(w2f__8) OpenAD_lin_26
      REAL(w2f__8) OpenAD_lin_27
      REAL(w2f__8) OpenAD_lin_28
      REAL(w2f__8) OpenAD_lin_29
      REAL(w2f__8) OpenAD_lin_3
      REAL(w2f__8) OpenAD_lin_30
      REAL(w2f__8) OpenAD_lin_31
      REAL(w2f__8) OpenAD_lin_32
      REAL(w2f__8) OpenAD_lin_33
      REAL(w2f__8) OpenAD_lin_34
      REAL(w2f__8) OpenAD_lin_35
      REAL(w2f__8) OpenAD_lin_36
      REAL(w2f__8) OpenAD_lin_37
      REAL(w2f__8) OpenAD_lin_38
      REAL(w2f__8) OpenAD_lin_39
      REAL(w2f__8) OpenAD_lin_4
      REAL(w2f__8) OpenAD_lin_40
      REAL(w2f__8) OpenAD_lin_41
      REAL(w2f__8) OpenAD_lin_42
      REAL(w2f__8) OpenAD_lin_43
      REAL(w2f__8) OpenAD_lin_44
      REAL(w2f__8) OpenAD_lin_45
      REAL(w2f__8) OpenAD_lin_46
      REAL(w2f__8) OpenAD_lin_47
      REAL(w2f__8) OpenAD_lin_48
      REAL(w2f__8) OpenAD_lin_5
      REAL(w2f__8) OpenAD_lin_6
      REAL(w2f__8) OpenAD_lin_7
      REAL(w2f__8) OpenAD_lin_8
      REAL(w2f__8) OpenAD_lin_9


          integer iaddr
          external iaddr
C
C     **** Statements ****
C

         if (our_rev_mode%plain) then
C original function
C$OPENAD XXX Template ad_template.f
      EOSJMDCKFW(1) = 1.9659330078E+04
      EOSJMDCKFW(2) = 1.4443040466E+02
      EOSJMDCKFW(3) = (-1.7061029673)
      EOSJMDCKFW(4) = 9.64870397E-03
      EOSJMDCKFW(5) = (-4.1902530938E-05)
      EOSJMDCKSW(1) = 5.2848548889E+01
      EOSJMDCKSW(2) = (-3.1010890007E-01)
      EOSJMDCKSW(3) = 6.2832632102E-03
      EOSJMDCKSW(4) = (-5.0841881603E-05)
      EOSJMDCKSW(5) = 3.8866400719E-01
      EOSJMDCKSW(6) = 9.085830301E-03
      EOSJMDCKSW(7) = (-4.6199240023E-04)
      EOSJMDCKP(1) = 3.1865189075
      EOSJMDCKP(2) = 2.2122759372E-02
      EOSJMDCKP(3) = (-2.9846420512E-04)
      EOSJMDCKP(4) = 1.9564149625E-06
      EOSJMDCKP(5) = 6.7043881863E-03
      EOSJMDCKP(6) = (-1.8473180535E-04)
      EOSJMDCKP(7) = 2.0593310524E-07
      EOSJMDCKP(8) = 1.480265928E-04
      EOSJMDCKP(9) = 2.1028979972E-04
      EOSJMDCKP(10) = (-1.2020160284E-05)
      EOSJMDCKP(11) = 1.3946799982E-07
      EOSJMDCKP(12) = (-2.0402369501E-06)
      EOSJMDCKP(13) = 6.128772867E-08
      EOSJMDCKP(14) = 6.2073229889E-10
      K = 1
      BI = 1
      BJ = 1
      SITOBAR = 1.0D00
      DO J = 1, 2, 1
        DO I = 1, 2, 1
          T%v = TFLD(I,J,K,BI,BJ)%v
          T2%v = (T%v*T%v)
          T3%v = (T%v*T2%v)
          T4%v = (T%v*T3%v)
          S%v = SFLD(I,J,K,BI,BJ)%v
          IF (S%v.GT.0.0D00) THEN
            S3O2%v = (S%v*SQRT(S%v))
          ELSE
            S%v = 0.0D00
            S3O2%v = 0.0D00
          ENDIF
          P%v = (LOCPRES(I,J)%v*SITOBAR)
          P2%v = (P%v*P%v)
          BMFRESH%v = (EOSJMDCKFW(1)+EOSJMDCKFW(2)*T%v+EOSJMDCKFW(3)*T2%
     +v+EOSJMDCKFW(4)*T3%v+EOSJMDCKFW(5)*T4%v)
          BMSALT%v = (S%v*(EOSJMDCKSW(1)+EOSJMDCKSW(2)*T%v+EOSJMDCKSW(3)
     +*T2%v+EOSJMDCKSW(4)*T3%v)+S3O2%v*(EOSJMDCKSW(5)+EOSJMDCKSW(6)*T%v+
     +EOSJMDCKSW(7)*T2%v))
          BMPRES%v = (P%v*(EOSJMDCKP(1)+EOSJMDCKP(2)*T%v+EOSJMDCKP(3)*T2
     +%v+EOSJMDCKP(4)*T3%v)+P%v*S%v*(EOSJMDCKP(5)+EOSJMDCKP(6)*T%v+EOSJM
     +DCKP(7)*T2%v)+EOSJMDCKP(8)*P%v*S3O2%v+P2%v*(EOSJMDCKP(9)+EOSJMDCKP
     +(10)*T%v+EOSJMDCKP(11)*T2%v)+P2%v*S%v*(EOSJMDCKP(12)+EOSJMDCKP(13)
     +*T%v+EOSJMDCKP(14)*T2%v))
          BULKMOD(INT(I),INT(J))%v = (BMPRES%v+BMFRESH%v+BMSALT%v)
        END DO
      END DO
          end if
          if (our_rev_mode%tape) then
C taping
C$OPENAD XXX Template ad_template.f
      EOSJMDCKFW(1) = 1.9659330078E+04
      EOSJMDCKFW(2) = 1.4443040466E+02
      EOSJMDCKFW(3) = (-1.7061029673)
      EOSJMDCKFW(4) = 9.64870397E-03
      EOSJMDCKFW(5) = (-4.1902530938E-05)
      EOSJMDCKSW(1) = 5.2848548889E+01
      EOSJMDCKSW(2) = (-3.1010890007E-01)
      EOSJMDCKSW(3) = 6.2832632102E-03
      EOSJMDCKSW(4) = (-5.0841881603E-05)
      EOSJMDCKSW(5) = 3.8866400719E-01
      EOSJMDCKSW(6) = 9.085830301E-03
      EOSJMDCKSW(7) = (-4.6199240023E-04)
      EOSJMDCKP(1) = 3.1865189075
      EOSJMDCKP(2) = 2.2122759372E-02
      EOSJMDCKP(3) = (-2.9846420512E-04)
      EOSJMDCKP(4) = 1.9564149625E-06
      EOSJMDCKP(5) = 6.7043881863E-03
      EOSJMDCKP(6) = (-1.8473180535E-04)
      EOSJMDCKP(7) = 2.0593310524E-07
      EOSJMDCKP(8) = 1.480265928E-04
      EOSJMDCKP(9) = 2.1028979972E-04
      EOSJMDCKP(10) = (-1.2020160284E-05)
      EOSJMDCKP(11) = 1.3946799982E-07
      EOSJMDCKP(12) = (-2.0402369501E-06)
      EOSJMDCKP(13) = 6.128772867E-08
      EOSJMDCKP(14) = 6.2073229889E-10
      K = 1
      BI = 1
      BJ = 1
      SITOBAR = 1.0D00
      OpenAD_Symbol_5 = 0_w2f__i8
      DO J = 1,2,1
        OpenAD_Symbol_6 = 0_w2f__i8
        DO I = 1,2,1
          T%v = TFLD(I,J,K,BI,BJ)%v
          OpenAD_lin_0 = T%v
          OpenAD_lin_1 = T%v
          T2%v = (T%v*T%v)
          OpenAD_lin_2 = T2%v
          OpenAD_lin_3 = T%v
          T3%v = (T%v*T2%v)
          OpenAD_lin_4 = T3%v
          OpenAD_lin_5 = T%v
          T4%v = (T%v*T3%v)
          S%v = SFLD(I,J,K,BI,BJ)%v
          OpenAD_acc_0 = (OpenAD_lin_0+OpenAD_lin_1)
          OpenAD_acc_1 = (OpenAD_lin_2+OpenAD_acc_0*OpenAD_lin_3)
          OpenAD_acc_2 = (OpenAD_lin_4+OpenAD_acc_1*OpenAD_lin_5)
          double_tape(double_tape_pointer) = OpenAD_acc_0
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_1
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_2
          double_tape_pointer = double_tape_pointer+1
          integer_tape(integer_tape_pointer) = I
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = J
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = K
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = BI
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = BJ
          integer_tape_pointer = integer_tape_pointer+1
          IF (S%v.GT.0.0D00) THEN
            OpenAD_aux_0 = SQRT(S%v)
            OpenAD_lin_6 = OpenAD_aux_0
            OpenAD_lin_8 = (5.0D-01/OpenAD_aux_0)
            OpenAD_lin_7 = S%v
            S3O2%v = (S%v*OpenAD_aux_0)
            OpenAD_acc_3 = (OpenAD_lin_8*OpenAD_lin_7)
            double_tape(double_tape_pointer) = OpenAD_lin_6
            double_tape_pointer = double_tape_pointer+1
            double_tape(double_tape_pointer) = OpenAD_acc_3
            double_tape_pointer = double_tape_pointer+1
            OpenAD_Symbol_7 = 1_w2f__i8
            integer_tape(integer_tape_pointer) = OpenAD_Symbol_7
            integer_tape_pointer = integer_tape_pointer+1
          ELSE
            S%v = 0.0D00
            S3O2%v = 0.0D00
            OpenAD_Symbol_8 = 0_w2f__i8
            integer_tape(integer_tape_pointer) = OpenAD_Symbol_8
            integer_tape_pointer = integer_tape_pointer+1
          ENDIF
          OpenAD_lin_9 = SITOBAR
          P%v = (LOCPRES(I,J)%v*SITOBAR)
          OpenAD_lin_10 = P%v
          OpenAD_lin_11 = P%v
          P2%v = (P%v*P%v)
          OpenAD_lin_12 = EOSJMDCKFW(2)
          OpenAD_lin_13 = EOSJMDCKFW(3)
          OpenAD_lin_14 = EOSJMDCKFW(4)
          OpenAD_lin_15 = EOSJMDCKFW(5)
          BMFRESH%v = (EOSJMDCKFW(1)+EOSJMDCKFW(2)*T%v+EOSJMDCKFW(3)*T2%
     +v+EOSJMDCKFW(4)*T3%v+EOSJMDCKFW(5)*T4%v)
          OpenAD_aux_1 = (EOSJMDCKSW(1)+EOSJMDCKSW(2)*T%v+EOSJMDCKSW(3)*
     +T2%v+EOSJMDCKSW(4)*T3%v)
          OpenAD_aux_2 = (EOSJMDCKSW(5)+EOSJMDCKSW(6)*T%v+EOSJMDCKSW(7)*
     +T2%v)
          OpenAD_lin_16 = OpenAD_aux_1
          OpenAD_lin_18 = EOSJMDCKSW(2)
          OpenAD_lin_19 = EOSJMDCKSW(3)
          OpenAD_lin_20 = EOSJMDCKSW(4)
          OpenAD_lin_17 = S%v
          OpenAD_lin_21 = OpenAD_aux_2
          OpenAD_lin_23 = EOSJMDCKSW(6)
          OpenAD_lin_24 = EOSJMDCKSW(7)
          OpenAD_lin_22 = S3O2%v
          BMSALT%v = (S%v*OpenAD_aux_1+S3O2%v*OpenAD_aux_2)
          OpenAD_aux_3 = (EOSJMDCKP(1)+EOSJMDCKP(2)*T%v+EOSJMDCKP(3)*T2%
     +v+EOSJMDCKP(4)*T3%v)
          OpenAD_aux_4 = (P%v*S%v)
          OpenAD_aux_5 = (EOSJMDCKP(5)+EOSJMDCKP(6)*T%v+EOSJMDCKP(7)*T2%
     +v)
          OpenAD_aux_6 = (P%v*S3O2%v)
          OpenAD_aux_7 = (EOSJMDCKP(9)+EOSJMDCKP(10)*T%v+EOSJMDCKP(11)*T
     +2%v)
          OpenAD_aux_8 = (P2%v*S%v)
          OpenAD_aux_9 = (EOSJMDCKP(12)+EOSJMDCKP(13)*T%v+EOSJMDCKP(14)*
     +T2%v)
          OpenAD_lin_25 = OpenAD_aux_3
          OpenAD_lin_27 = EOSJMDCKP(2)
          OpenAD_lin_28 = EOSJMDCKP(3)
          OpenAD_lin_29 = EOSJMDCKP(4)
          OpenAD_lin_26 = P%v
          OpenAD_lin_32 = S%v
          OpenAD_lin_33 = P%v
          OpenAD_lin_30 = OpenAD_aux_5
          OpenAD_lin_34 = EOSJMDCKP(6)
          OpenAD_lin_35 = EOSJMDCKP(7)
          OpenAD_lin_31 = OpenAD_aux_4
          OpenAD_lin_37 = S3O2%v
          OpenAD_lin_38 = P%v
          OpenAD_lin_36 = EOSJMDCKP(8)
          OpenAD_lin_39 = OpenAD_aux_7
          OpenAD_lin_41 = EOSJMDCKP(10)
          OpenAD_lin_42 = EOSJMDCKP(11)
          OpenAD_lin_40 = P2%v
          OpenAD_lin_45 = S%v
          OpenAD_lin_46 = P2%v
          OpenAD_lin_43 = OpenAD_aux_9
          OpenAD_lin_47 = EOSJMDCKP(13)
          OpenAD_lin_48 = EOSJMDCKP(14)
          OpenAD_lin_44 = OpenAD_aux_8
          BMPRES%v = (P%v*OpenAD_aux_3+OpenAD_aux_4*OpenAD_aux_5+EOSJMDC
     +KP(8)*OpenAD_aux_6+P2%v*OpenAD_aux_7+OpenAD_aux_8*OpenAD_aux_9)
          BULKMOD(INT(I),INT(J))%v = (BMPRES%v+BMFRESH%v+BMSALT%v)
          OpenAD_acc_4 = (OpenAD_lin_46*OpenAD_lin_43)
          OpenAD_acc_5 = (OpenAD_lin_33*OpenAD_lin_30)
          OpenAD_acc_6 = (OpenAD_lin_29*OpenAD_lin_26)
          OpenAD_acc_7 = (OpenAD_lin_20*OpenAD_lin_17)
          OpenAD_acc_8 = (OpenAD_lin_48*OpenAD_lin_44)
          OpenAD_acc_9 = (OpenAD_lin_42*OpenAD_lin_40)
          OpenAD_acc_10 = (OpenAD_lin_35*OpenAD_lin_31)
          OpenAD_acc_11 = (OpenAD_lin_28*OpenAD_lin_26)
          OpenAD_acc_12 = (OpenAD_lin_24*OpenAD_lin_22)
          OpenAD_acc_13 = (OpenAD_lin_19*OpenAD_lin_17)
          OpenAD_acc_14 = (OpenAD_lin_47*OpenAD_lin_44)
          OpenAD_acc_15 = (OpenAD_lin_41*OpenAD_lin_40)
          OpenAD_acc_16 = (OpenAD_lin_38*OpenAD_lin_36)
          OpenAD_acc_17 = (OpenAD_lin_34*OpenAD_lin_31)
          OpenAD_acc_18 = (OpenAD_lin_27*OpenAD_lin_26)
          OpenAD_acc_19 = (OpenAD_lin_23*OpenAD_lin_22)
          OpenAD_acc_20 = (OpenAD_lin_18*OpenAD_lin_17)
          OpenAD_acc_21 = (OpenAD_lin_10+OpenAD_lin_11)
          OpenAD_acc_22 = (OpenAD_lin_9*OpenAD_lin_25+OpenAD_lin_9*OpenA
     +D_acc_21*OpenAD_lin_45*OpenAD_lin_43+OpenAD_lin_9*OpenAD_acc_21*Op
     +enAD_lin_39+OpenAD_lin_9*OpenAD_lin_32*OpenAD_lin_30+OpenAD_lin_9*
     +OpenAD_lin_37*OpenAD_lin_36)
          double_tape(double_tape_pointer) = OpenAD_acc_22
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_lin_16
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_4
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_5
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_6
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_lin_21
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_7
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_8
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_9
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_10
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_11
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_12
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_13
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_14
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_15
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_16
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_17
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_18
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_19
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_acc_20
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_lin_13
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_lin_14
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_lin_15
          double_tape_pointer = double_tape_pointer+1
          double_tape(double_tape_pointer) = OpenAD_lin_12
          double_tape_pointer = double_tape_pointer+1
          integer_tape(integer_tape_pointer) = I
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = J
          integer_tape_pointer = integer_tape_pointer+1
          OpenAD_Symbol_6 = (INT(OpenAD_Symbol_6)+INT(1_w2f__i8))
        END DO
        integer_tape(integer_tape_pointer) = OpenAD_Symbol_6
        integer_tape_pointer = integer_tape_pointer+1
        OpenAD_Symbol_5 = (INT(OpenAD_Symbol_5)+INT(1_w2f__i8))
      END DO
      integer_tape(integer_tape_pointer) = OpenAD_Symbol_5
      integer_tape_pointer = integer_tape_pointer+1
          end if
          if (our_rev_mode%adjoint) then
C adjoint
      integer_tape_pointer = integer_tape_pointer-1
      OpenAD_Symbol_0 = integer_tape(integer_tape_pointer)
      OpenAD_Symbol_1 = 1
      do while (INT(OpenAD_Symbol_1).LE.INT(OpenAD_Symbol_0))
        integer_tape_pointer = integer_tape_pointer-1
        OpenAD_Symbol_2 = integer_tape(integer_tape_pointer)
        OpenAD_Symbol_3 = 1
        do while (INT(OpenAD_Symbol_3).LE.INT(OpenAD_Symbol_2))
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_71 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_72 = integer_tape(integer_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_73 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_74 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_75 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_76 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_77 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_78 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_79 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_80 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_81 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_82 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_83 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_84 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_85 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_86 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_87 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_88 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_89 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_90 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_91 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_92 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_93 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_94 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_95 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_96 = double_tape(double_tape_pointer)
          T%d = T%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_73)
          T4%d = T4%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_74)
          T3%d = T3%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_75)
          T2%d = T2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_76)
          T%d = T%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_77)
          T%d = T%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_78)
          T%d = T%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_79)
          T%d = T%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_80)
          S3O2%d = S3O2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(
     +OpenAD_Symbol_81)
          T%d = T%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_82)
          T%d = T%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_83)
          T2%d = T2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_84)
          T2%d = T2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_85)
          T2%d = T2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_86)
          T2%d = T2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_87)
          T2%d = T2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_88)
          T2%d = T2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_89)
          T3%d = T3%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_90)
          S3O2%d = S3O2%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(
     +OpenAD_Symbol_91)
          T3%d = T3%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(Open
     +AD_Symbol_92)
          S%d = S%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_93)
          S%d = S%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_94)
          S%d = S%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d*(OpenAD
     +_Symbol_95)
          LOCPRES(OpenAD_Symbol_72,OpenAD_Symbol_71)%d = LOCPRES(OpenAD_
     +Symbol_72,OpenAD_Symbol_71)%d+BULKMOD(OpenAD_Symbol_72,OpenAD_Symb
     +ol_71)%d*(OpenAD_Symbol_96)
          BULKMOD(OpenAD_Symbol_72,OpenAD_Symbol_71)%d = 0.0d0
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_4 = integer_tape(integer_tape_pointer)
          IF (OpenAD_Symbol_4.ne.0) THEN
            double_tape_pointer = double_tape_pointer-1
            OpenAD_Symbol_69 = double_tape(double_tape_pointer)
            double_tape_pointer = double_tape_pointer-1
            OpenAD_Symbol_70 = double_tape(double_tape_pointer)
            S%d = S%d+S3O2%d*(OpenAD_Symbol_69)
            S%d = S%d+S3O2%d*(OpenAD_Symbol_70)
            S3O2%d = 0.0d0
          ELSE
            S3O2%d = 0.0d0
            S%d = 0.0d0
          ENDIF
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_61 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_62 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_63 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_64 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_65 = integer_tape(integer_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_66 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_67 = double_tape(double_tape_pointer)
          double_tape_pointer = double_tape_pointer-1
          OpenAD_Symbol_68 = double_tape(double_tape_pointer)
          SFLD(OpenAD_Symbol_65,OpenAD_Symbol_64,OpenAD_Symbol_63,OpenAD
     +_Symbol_62,OpenAD_Symbol_61)%d = SFLD(OpenAD_Symbol_65,OpenAD_Symb
     +ol_64,OpenAD_Symbol_63,OpenAD_Symbol_62,OpenAD_Symbol_61)%d+S%d
          S%d = 0.0d0
          T%d = T%d+T4%d*(OpenAD_Symbol_66)
          T4%d = 0.0d0
          T%d = T%d+T3%d*(OpenAD_Symbol_67)
          T3%d = 0.0d0
          T%d = T%d+T2%d*(OpenAD_Symbol_68)
          T2%d = 0.0d0
          TFLD(OpenAD_Symbol_65,OpenAD_Symbol_64,OpenAD_Symbol_63,OpenAD
     +_Symbol_62,OpenAD_Symbol_61)%d = TFLD(OpenAD_Symbol_65,OpenAD_Symb
     +ol_64,OpenAD_Symbol_63,OpenAD_Symbol_62,OpenAD_Symbol_61)%d+T%d
          T%d = 0.0d0
          OpenAD_Symbol_3 = INT(OpenAD_Symbol_3)+1
        END DO
        OpenAD_Symbol_1 = INT(OpenAD_Symbol_1)+1
      END DO
          end if
        end subroutine find_bulkmod
C#########################################################
C This file is part of OpenAD released under the LGPL.   #
C The full COPYRIGHT notice can be found in the top      #
C level directory of the OpenAD distribution             #
C#########################################################

      SUBROUTINE head(X, Y)
          use OAD_tape
          use OAD_rev

C original arguments get inserted before version
C         ! and declared here together with all local variables
C         ! generated by xaifBooster

      use OAD_active
      use w2f__types
      use oad_intrinsics
      use oad_intrinsics
      use oad_intrinsics
      IMPLICIT NONE
C
C     **** Global Variables & Derived Type Definitions ****
C
      INTEGER(w2f__i8) OpenAD_Symbol_18
      INTEGER(w2f__i8) OpenAD_Symbol_19
      INTEGER(w2f__i8) OpenAD_Symbol_20
      INTEGER(w2f__i8) OpenAD_Symbol_21
      INTEGER(w2f__i8) OpenAD_Symbol_22
      INTEGER(w2f__i8) OpenAD_Symbol_23
      INTEGER(w2f__i8) OpenAD_Symbol_24
      INTEGER(w2f__i8) OpenAD_Symbol_25
      INTEGER(w2f__i8) OpenAD_Symbol_26
      INTEGER(w2f__i8) OpenAD_Symbol_27
      INTEGER(w2f__i8) OpenAD_Symbol_28
      INTEGER(w2f__i8) OpenAD_Symbol_29
      INTEGER(w2f__i8) OpenAD_Symbol_30
      INTEGER(w2f__i8) OpenAD_Symbol_31
      INTEGER(w2f__i8) OpenAD_Symbol_32
      INTEGER(w2f__i8) OpenAD_Symbol_33
      INTEGER(w2f__i8) OpenAD_Symbol_34
      INTEGER(w2f__i8) OpenAD_Symbol_35
      INTEGER(w2f__i8) OpenAD_Symbol_36
      INTEGER(w2f__i8) OpenAD_Symbol_37
      INTEGER(w2f__i8) OpenAD_Symbol_38
      INTEGER(w2f__i8) OpenAD_Symbol_39
      INTEGER(w2f__i8) OpenAD_Symbol_40
      INTEGER(w2f__i8) OpenAD_Symbol_41
      INTEGER(w2f__i8) OpenAD_Symbol_42
      INTEGER(w2f__i8) OpenAD_Symbol_43
      INTEGER(w2f__i8) OpenAD_Symbol_44
      INTEGER(w2f__i8) OpenAD_Symbol_45
      INTEGER(w2f__i8) OpenAD_Symbol_46
      INTEGER(w2f__i8) OpenAD_Symbol_47
      INTEGER(w2f__i8) OpenAD_Symbol_48
      INTEGER(w2f__i8) OpenAD_Symbol_49
      INTEGER(w2f__i8) OpenAD_Symbol_50
      INTEGER(w2f__i8) OpenAD_Symbol_51
      INTEGER(w2f__i8) OpenAD_Symbol_52
      INTEGER(w2f__i8) OpenAD_Symbol_53
      INTEGER(w2f__i8) OpenAD_Symbol_54
      INTEGER(w2f__i8) OpenAD_Symbol_55
      INTEGER(w2f__i8) OpenAD_Symbol_56
      INTEGER(w2f__i8) OpenAD_Symbol_57
      INTEGER(w2f__i8) OpenAD_Symbol_58
      INTEGER(w2f__i8) OpenAD_Symbol_59
C
C     **** Parameters and Result ****
C
      type(active) :: X(1:32)
      type(active) :: Y(1:4)
C
C     **** Local Variables and Functions ****
C
      type(active) :: BULKMOD(1:2,1:2)
      EXTERNAL find_bulkmod
      INTEGER(w2f__i4) I
      INTEGER(w2f__i4) J
      INTEGER(w2f__i4) K
      INTEGER(w2f__i4) L
      type(active) :: LOCPRES(1:2,1:2)
      INTEGER(w2f__i4) M
      type(active) :: SFLD(1:2,1:2,1:2,1:2,1:2)
      type(active) :: TFLD(1:2,1:2,1:2,1:2,1:2)
      INTEGER(w2f__i4) XCOUNT
      INTEGER(w2f__i4) OpenAD_Symbol_100
      INTEGER(w2f__i4) OpenAD_Symbol_101
      INTEGER(w2f__i4) OpenAD_Symbol_102
      INTEGER(w2f__i4) OpenAD_Symbol_103
      INTEGER(w2f__i4) OpenAD_Symbol_104
      INTEGER(w2f__i4) OpenAD_Symbol_105
      INTEGER(w2f__i4) OpenAD_Symbol_106
      INTEGER(w2f__i4) OpenAD_Symbol_107
      INTEGER(w2f__i4) OpenAD_Symbol_108
      INTEGER(w2f__i4) OpenAD_Symbol_60
      INTEGER(w2f__i4) OpenAD_Symbol_97
      INTEGER(w2f__i4) OpenAD_Symbol_98
      INTEGER(w2f__i4) OpenAD_Symbol_99


          integer iaddr
          external iaddr
C
C     **** Top Level Pragmas ****
C
C$OPENAD INDEPENDENT(X)
C$OPENAD DEPENDENT(Y)
C
C     **** Statements ****
C

         if (our_rev_mode%plain) then
C original function
C$OPENAD XXX Template ad_template.f
      XCOUNT = 1
      DO I = 1, 2, 1
        DO J = 1, 2, 1
          LOCPRES(INT(I),INT(J))%v = (X(XCOUNT)%v*2.0D00)
          DO K = 1,2,1
            DO L = 1,2,1
              DO M = 1,2,1
                TFLD(INT(I),INT(J),INT(K),INT(L),INT(M))%v = (X(XCOUNT)%
     +v*3.0D00)
                SFLD(INT(I),INT(J),INT(K),INT(L),INT(M))%v = (X(XCOUNT)%
     +v*4.0D00)
                XCOUNT = (XCOUNT+1)
              END DO
            END DO
          END DO
        END DO
      END DO
      CALL find_bulkmod(LOCPRES,TFLD,SFLD,BULKMOD)
      DO I = 1,2,1
        DO J = 1,2,1
          Y(J+I*2+(-2))%v = BULKMOD(I,J)%v
        END DO
      END DO
          end if
          if (our_rev_mode%tape) then
C taping
C$OPENAD XXX Template ad_template.f
      XCOUNT = 1
      OpenAD_Symbol_32 = 0_w2f__i8
      DO I = 1,2,1
        OpenAD_Symbol_33 = 0_w2f__i8
        DO J = 1,2,1
          LOCPRES(INT(I),INT(J))%v = (X(XCOUNT)%v*2.0D00)
          integer_tape(integer_tape_pointer) = XCOUNT
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = I
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = J
          integer_tape_pointer = integer_tape_pointer+1
          OpenAD_Symbol_34 = 0_w2f__i8
          DO K = 1,2,1
            OpenAD_Symbol_35 = 0_w2f__i8
            DO L = 1,2,1
              OpenAD_Symbol_36 = 0_w2f__i8
              DO M = 1,2,1
                TFLD(INT(I),INT(J),INT(K),INT(L),INT(M))%v = (X(XCOUNT)%
     +v*3.0D00)
                SFLD(INT(I),INT(J),INT(K),INT(L),INT(M))%v = (X(XCOUNT)%
     +v*4.0D00)
                integer_tape(integer_tape_pointer) = XCOUNT
                integer_tape_pointer = integer_tape_pointer+1
                integer_tape(integer_tape_pointer) = I
                integer_tape_pointer = integer_tape_pointer+1
                integer_tape(integer_tape_pointer) = J
                integer_tape_pointer = integer_tape_pointer+1
                integer_tape(integer_tape_pointer) = K
                integer_tape_pointer = integer_tape_pointer+1
                integer_tape(integer_tape_pointer) = L
                integer_tape_pointer = integer_tape_pointer+1
                integer_tape(integer_tape_pointer) = M
                integer_tape_pointer = integer_tape_pointer+1
                XCOUNT = (XCOUNT+1)
                OpenAD_Symbol_36 = (INT(OpenAD_Symbol_36)+INT(1_w2f__i8)
     +)
              END DO
              integer_tape(integer_tape_pointer) = OpenAD_Symbol_36
              integer_tape_pointer = integer_tape_pointer+1
              OpenAD_Symbol_35 = (INT(OpenAD_Symbol_35)+INT(1_w2f__i8))
            END DO
            integer_tape(integer_tape_pointer) = OpenAD_Symbol_35
            integer_tape_pointer = integer_tape_pointer+1
            OpenAD_Symbol_34 = (INT(OpenAD_Symbol_34)+INT(1_w2f__i8))
          END DO
          integer_tape(integer_tape_pointer) = OpenAD_Symbol_34
          integer_tape_pointer = integer_tape_pointer+1
          OpenAD_Symbol_33 = (INT(OpenAD_Symbol_33)+INT(1_w2f__i8))
        END DO
        integer_tape(integer_tape_pointer) = OpenAD_Symbol_33
        integer_tape_pointer = integer_tape_pointer+1
        OpenAD_Symbol_32 = (INT(OpenAD_Symbol_32)+INT(1_w2f__i8))
      END DO
      integer_tape(integer_tape_pointer) = OpenAD_Symbol_32
      integer_tape_pointer = integer_tape_pointer+1
      CALL find_bulkmod(LOCPRES,TFLD,SFLD,BULKMOD)
      OpenAD_Symbol_37 = 0_w2f__i8
      DO I = 1,2,1
        OpenAD_Symbol_38 = 0_w2f__i8
        DO J = 1,2,1
          Y(J+I*2+(-2))%v = BULKMOD(I,J)%v
          OpenAD_Symbol_60 = (J+I*2+(-2))
          integer_tape(integer_tape_pointer) = OpenAD_Symbol_60
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = I
          integer_tape_pointer = integer_tape_pointer+1
          integer_tape(integer_tape_pointer) = J
          integer_tape_pointer = integer_tape_pointer+1
          OpenAD_Symbol_38 = (INT(OpenAD_Symbol_38)+INT(1_w2f__i8))
        END DO
        integer_tape(integer_tape_pointer) = OpenAD_Symbol_38
        integer_tape_pointer = integer_tape_pointer+1
        OpenAD_Symbol_37 = (INT(OpenAD_Symbol_37)+INT(1_w2f__i8))
      END DO
      integer_tape(integer_tape_pointer) = OpenAD_Symbol_37
      integer_tape_pointer = integer_tape_pointer+1
          end if
          if (our_rev_mode%adjoint) then
C adjoint
      integer_tape_pointer = integer_tape_pointer-1
      OpenAD_Symbol_18 = integer_tape(integer_tape_pointer)
      OpenAD_Symbol_19 = 1
      do while (INT(OpenAD_Symbol_19).LE.INT(OpenAD_Symbol_18))
        integer_tape_pointer = integer_tape_pointer-1
        OpenAD_Symbol_20 = integer_tape(integer_tape_pointer)
        OpenAD_Symbol_21 = 1
        do while (INT(OpenAD_Symbol_21).LE.INT(OpenAD_Symbol_20))
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_106 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_107 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_108 = integer_tape(integer_tape_pointer)
          BULKMOD(OpenAD_Symbol_107,OpenAD_Symbol_106)%d = BULKMOD(OpenA
     +D_Symbol_107,OpenAD_Symbol_106)%d+Y(OpenAD_Symbol_108)%d
          Y(OpenAD_Symbol_108)%d = 0.0d0
          OpenAD_Symbol_21 = INT(OpenAD_Symbol_21)+1
        END DO
        OpenAD_Symbol_19 = INT(OpenAD_Symbol_19)+1
      END DO
      CALL find_bulkmod(LOCPRES,TFLD,SFLD,BULKMOD)
      integer_tape_pointer = integer_tape_pointer-1
      OpenAD_Symbol_22 = integer_tape(integer_tape_pointer)
      OpenAD_Symbol_23 = 1
      do while (INT(OpenAD_Symbol_23).LE.INT(OpenAD_Symbol_22))
        integer_tape_pointer = integer_tape_pointer-1
        OpenAD_Symbol_24 = integer_tape(integer_tape_pointer)
        OpenAD_Symbol_25 = 1
        do while (INT(OpenAD_Symbol_25).LE.INT(OpenAD_Symbol_24))
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_26 = integer_tape(integer_tape_pointer)
          OpenAD_Symbol_27 = 1
          do while (INT(OpenAD_Symbol_27).LE.INT(OpenAD_Symbol_26))
            integer_tape_pointer = integer_tape_pointer-1
            OpenAD_Symbol_28 = integer_tape(integer_tape_pointer)
            OpenAD_Symbol_29 = 1
            do while (INT(OpenAD_Symbol_29).LE.INT(OpenAD_Symbol_28))
              integer_tape_pointer = integer_tape_pointer-1
              OpenAD_Symbol_30 = integer_tape(integer_tape_pointer)
              OpenAD_Symbol_31 = 1
              do while (INT(OpenAD_Symbol_31).LE.INT(OpenAD_Symbol_30))
                integer_tape_pointer = integer_tape_pointer-1
                OpenAD_Symbol_100 = integer_tape(integer_tape_pointer)
                integer_tape_pointer = integer_tape_pointer-1
                OpenAD_Symbol_101 = integer_tape(integer_tape_pointer)
                integer_tape_pointer = integer_tape_pointer-1
                OpenAD_Symbol_102 = integer_tape(integer_tape_pointer)
                integer_tape_pointer = integer_tape_pointer-1
                OpenAD_Symbol_103 = integer_tape(integer_tape_pointer)
                integer_tape_pointer = integer_tape_pointer-1
                OpenAD_Symbol_104 = integer_tape(integer_tape_pointer)
                integer_tape_pointer = integer_tape_pointer-1
                OpenAD_Symbol_105 = integer_tape(integer_tape_pointer)
                X(OpenAD_Symbol_105)%d = X(OpenAD_Symbol_105)%d+SFLD(Ope
     +nAD_Symbol_104,OpenAD_Symbol_103,OpenAD_Symbol_102,OpenAD_Symbol_1
     +01,OpenAD_Symbol_100)%d*(4.0D00)
                SFLD(OpenAD_Symbol_104,OpenAD_Symbol_103,OpenAD_Symbol_1
     +02,OpenAD_Symbol_101,OpenAD_Symbol_100)%d = 0.0d0
                X(OpenAD_Symbol_105)%d = X(OpenAD_Symbol_105)%d+TFLD(Ope
     +nAD_Symbol_104,OpenAD_Symbol_103,OpenAD_Symbol_102,OpenAD_Symbol_1
     +01,OpenAD_Symbol_100)%d*(3.0D00)
                TFLD(OpenAD_Symbol_104,OpenAD_Symbol_103,OpenAD_Symbol_1
     +02,OpenAD_Symbol_101,OpenAD_Symbol_100)%d = 0.0d0
                OpenAD_Symbol_31 = INT(OpenAD_Symbol_31)+1
              END DO
              OpenAD_Symbol_29 = INT(OpenAD_Symbol_29)+1
            END DO
            OpenAD_Symbol_27 = INT(OpenAD_Symbol_27)+1
          END DO
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_97 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_98 = integer_tape(integer_tape_pointer)
          integer_tape_pointer = integer_tape_pointer-1
          OpenAD_Symbol_99 = integer_tape(integer_tape_pointer)
          X(OpenAD_Symbol_99)%d = X(OpenAD_Symbol_99)%d+LOCPRES(OpenAD_S
     +ymbol_98,OpenAD_Symbol_97)%d*(2.0D00)
          LOCPRES(OpenAD_Symbol_98,OpenAD_Symbol_97)%d = 0.0d0
          OpenAD_Symbol_25 = INT(OpenAD_Symbol_25)+1
        END DO
        OpenAD_Symbol_23 = INT(OpenAD_Symbol_23)+1
      END DO
          end if
        end subroutine head
